<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>File Upload Popup</title>
    <style>
        /* 弹框的样式 */
        #fileUploadPopup {
            display: none;
            position: fixed;
            z-index: 9999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.5);
        }

        /* 弹框内容的样式 */
        #fileUploadPopupContent {
            background-color: #fff;
            margin: 15% auto;
            padding: 20px;
            border-radius: 10px;
            width: 400px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            overflow: auto;
        }

        /* 关闭按钮的样式 */
        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            transition: 0.3s;
        }

        .close:hover,
        .close:focus {
            color: black;
            text-decoration: none;
            cursor: pointer;
        }

        /* 表单样式 */
        #fileUploadForm {
            margin-bottom: 20px;
        }

        /* 文件输入和按钮的样式 */
        #fileInput {
            display: block;
            margin-bottom: 10px;
        }

        .file-upload-btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007BFF;
            color: #fff;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            transition: 0.3s;
        }

        .file-upload-btn:hover {
            background-color: #0056b3;
        }

        .cancel-btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #e9ecef;
            color: #333;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            transition: 0.3s;
        }

        .cancel-btn:hover {
            background-color: #ddd;
        }
    </style>
</head>

<body>
    <div>
        <div class="content">
            <div class="box2">
                <h3 class="text"> data.senderName</h3>
                <p>申请理由:</p>
                <p class="text">data.reason
                </p>
                <button class="agree" data-sender-id=" 1">同意</button>
                <button class="disagree" onclick="disagree()">拒绝</button>
            </div>
        </div>

    </div>

   
    <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 假设这些按钮已经存在于页面上  
            var agreeButtons = document.querySelectorAll('.agree');

            agreeButtons.forEach(function (button) {
                button.addEventListener('click', function () {
                    var senderId = this.getAttribute('data-sender-id');
                    agree(senderId); // 调用函数并传递 senderId  
                });
            });
        });

        function agree(senderId) {
            // 处理 senderId  
            console.log('Agreed with sender ID:', senderId);
        }
    </script>

</body>

</html>